<!DOCTYPE html>
<html>
<#include "../head.html">
    <body class="full">
    <div class="mc">
        <div class="mc-l">
            <!--左侧导航---{-->
            <div id="navPanelContainer">
                <div class="system-logo cd"></div>
                <!--管理员信息---{-->
                <#include "../adminInfo.html">
                    <!--管理员信息---}-->
                    <div class="nav-wrap">
                        <#include "left.html">
                    </div>
            </div>
            <!--左侧导航---}-->
        </div>
        <div class="mc-m">
            <div class="navToggle"></div>
        </div>
        <div class="mc-r">
            <!--顶部导航---{-->
            <#include "../topNav.html">
                <!--顶部导航---}-->

                <!--面包屑导航---{-->
                <#assign moduleName="查看消息">
                    <#include "banner.html">
                        <!--面包屑导航---}-->

                        <!--工具栏--{-->
                        <div id="toolbar" class="clearfix">
                            <div class="toolbor-module search">
                                <input type="button" value="搜索"  class="input-button" onclick="sousuo();">
                            </div>
                            <div class="toolbor-module search">
                                <div class="formTit">模板名称：</div>
                                <select id="msgTemplateType">
                                    <option value="0">全部</option>
                                    <#if tList??>
                                        <#list tList as item>
                                            <option value="${item.id?c}">${item.name}</option>
                                        </#list>
                                    </#if>
                                </select>
                            </div>
                            <div class="toolbor-module search">
                                <div class="formTit">消息类型：</div>
                                <select id="msgType">
                                    <option value="0">全部</option>
                                    <option value="2">邮件</option>
                                    <option value="3">短信</option>
                                </select>
                            </div>
                            <div class="toolbor-module search">
                                <div class="formTit">业务名称：</div>
                                <select id="msgOperateType">
                                    <option value="0">全部</option>
                                    <#if oList??>
                                        <#list oList as item>
                                            <#if item.id!=1>
                                                <option value="${item.id?c}">${item.name}</option>
                                            </#if>
                                        </#list>
                                    </#if>
                                </select>
                            </div>
                            <div class="toolbor-module search">
                                <div class="formTit">用户名：</div>
                                <input type="text" name="showName" id="showName" value="请输入用户名"  class="search-value">
                                <div class="formTit">手机：</div>
                                <input type="text" name="phone" id="phone" value="请输入手机"  class="search-value">
                            </div>
                        </div>
                        <!--工具栏--}-->

                        <div id="main" class="clearfix">
                            <form action="" method="post">
                                <table class="data-list">
                                    <tr class="header">
                                        <td>ID</td>
                                        <td>用户名</td>
                                        <td>业务名称</td>
                                        <td>消息类型</td>
                                        <td>模板名称</td>
                                        <td>发送时间</td>
                                        <td>返回结果</td>
                                        <td>操作</td>
                                    </tr>
                                    <#if list??>
                                        <#list list as item>
                                            <tr class="s">
                                                <td>${item.id?c}</td>
                                                <td><#if item.receiver??>${item.receiver.showName!'-'}<#else>-</#if></td>
                                                <td><#if item.msgOperate??>${item.msgOperate.name!'-'}<#else>-</#if></td>
                                                <td><#if item.msgType??>${item.msgType.name!'-'}<#else>-</#if></td>
                                                <td><#if item.msgTemplate??>${item.msgTemplate.name!'-'}<#else>-</#if></td>
                                                <td>${item.sendTime}</td>
                                                <td>${item.resultMsg!''}</td>
                                                <td>
                                                    <a class="un" href="/admin/msg/showMsgRecordDetail.html?id=${item.id?c}">查看内容</a>
                                                    <!--   &nbsp;<a class="un" href="#" onclick="javascript:if(confirm( '模板删除后不可还原，确定删除模板？')) href= '/admin/msg/delTemplate.html?id=${item.id!0}'; else return;">删除</a>
                                                 -->
                                                </td>
                                            </tr>
                                        </#list>
                                    </#if>
                                </table>
                            </form>

                            <!--底部工具栏--{-->
                            <div id="bottomToolbar" class="clearfix">
                                <div class="other-tool">
                                    <dl class="refresh-data">
                                        <dt class="refresh-data-icon"></dt>
                                        <dd><a href="javascript:void(0);" class="refresh-page">刷新数据</a></dd>
                                    </dl>
                                </div>

                                <!--翻页系统--{-->
                                <div class="container s_formPage">
                                    <#import "../../common/page.html" as pager>
                                        <@pager.pagination page=page url="${pageUrl}" map=param style="style1" />
                                </div>
                                <!--翻页系统--}-->
                            </div>
                            <!--底部工具栏--}-->

                            <script>
                                var urls = '?search=true';
                                function sousuo(){
                                    var sou = "";
                                    var showName = $("#showName").val();
                                    var phone = $("#phone").val();
                                    var msgType = $("#msgType").find("option:selected").val();
                                    var msgOperateType = $("#msgOperateType").find("option:selected").val();
                                    var msgTemplateType = $("#msgTemplateType").find("option:selected").val();
                                    if (showName!=null&&showName!=""&&showName!="undefine"&&showName!="请输入用户名"){
                                        sou += "&showName="+showName;
                                    }
                                    if(msgType!=null&&msgType!=""&&msgType!="undefine"){
                                        sou += "&msgType="+msgType;
                                    }
                                    if(msgOperateType!=null&&msgOperateType!=""&&msgOperateType!="undefine"){
                                        sou += "&msgOperateType="+msgOperateType;
                                    }
                                    if(msgTemplateType!=null&&msgTemplateType!=""&&msgTemplateType!="undefine"){
                                        sou += "&msgTemplateType="+msgTemplateType;
                                    }
                                    if(phone!=null&&phone!=""&&phone!="undefine"&&phone!="请输入手机"){
                                        sou += "&phone="+phone;
                                    }
                                    var url=urls+sou
                                    location.href=url;
                                }
                            </script>

                        </div>
        </div>
    </div>
    <div class="mc-b">
        <#include "../foot.html">
    </div>
    <#include "../jsPage.html">
    </body>
</html>
